import Vue from "vue";
import {UI_CACHE_DB_DICT_DATA} from '@store/mutationTypes'
import {postAction} from "@api/manage";

const api = {
    getDictItemsFromCache:function (dictCode){
        if(Vue.ls.get(UI_CACHE_DB_DICT_DATA) && Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode]){
            let dictItems = Vue.ls.get(UI_CACHE_DB_DICT_DATA)[dictCode];
            console.log("-----------getDictItemsFromCache----------dictCode="+dictCode+"---- dictItems=",dictItems)
            return dictItems;
        }
    },

    ajaxGetDictItems: (params)=>postAction(`/common/selectOptions`,params ),
};

export default  api;
